<?php
# http://www.sitepoint.com/forums/showthread.php?t=688444

$number = "12,345,689"; 
echo $number."<br><br/>"; 

$length = strlen($number); 
$digits = array(); 
$i=1; 
while($length >= $i){ 
    array_push($digits,substr($number, -$i,1)); 
$i++; 
} 
$digits = array_reverse($digits); 
print_r($digits); 

/*// results in 
Array 
( 
    [0] => 1 
    [1] => 2 
    [2] => , 
    [3] => 3 
    [4] => 4 
    [5] => 5 
    [6] => , 
    [7] => 6 
    [8] => 8 
    [9] => 9 
)*/

print_r(str_split($number));

$fancy_images = preg_replace('/([\d])/', '<img src="fancy/$1.jpg">', preg_replace('/[^\d]+/', '', $number));
echo $fancy_images;
die('-'.$fancy_images);

$numbers = str_split(preg_replace('/[^\d]+/', '', $number));
print_r($numbers);
/*
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
    [4] => 5
    [5] => 6
    [6] => 8
    [7] => 9
)*/

?>